﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace DataAccess
{
    public class DuLieu
    {
        public static void GetValueInCombo(object value, ComboBox cb)
        {
            try
            {
                for (int i = 0; i < cb.Items.Count; i++)
                {

                    cb.SelectedIndex = i;
                    if (cb.SelectedValue.ToString() == value.ToString())
                        return;
                }
            }
            catch (Exception)
            { }

        }
        public static void GetGioiTinh(object boolGioiTinh, ComboBox cb)
        {
            try
            {
                bool gt = Convert.ToBoolean(boolGioiTinh);
                if (gt)
                    cb.SelectedIndex = (cb.Items[0].ToString() == "Nam") ? 0 : 1;
                else
                    cb.SelectedIndex = (cb.Items[0].ToString() == "Nữ") ? 0 : 1;
            }
            catch (Exception)
            {

            }
        }
       
    }
}
